//
//  HXTConsumCell.m
//  掌上宏力
//
//  Created by admin on 2017/6/14.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "HXTConsumCell.h"
#import "HXTFLConsumModel.h"

@interface HXTConsumCell ()

@property (nonatomic,weak) UILabel *shopNameL;
@property (nonatomic,weak) UILabel *goodNameL;
@property (nonatomic,weak) UILabel *typeL;
@property (nonatomic,weak) UILabel *amountL;

@end

@implementation HXTConsumCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat left_dis = 15;
        CGFloat width = kScreenW - left_dis - 50;
        CGFloat height = 30;
        
        UILabel *shopNameL = [Factory createLabelWithFrame:CGRectMake(left_dis, 5, width, height) fontSize:16];
        [self.contentView addSubview:shopNameL];
        self.shopNameL = shopNameL;
        
        UILabel *goodNameL = [Factory createLabelWithFrame:CGRectMake(left_dis, shopNameL.bottom, width, height) fontSize:16];
        [self.contentView addSubview:goodNameL];
        self.goodNameL = goodNameL;
        
        UILabel *typeL = [Factory createLabelWithFrame:CGRectMake(left_dis, goodNameL.bottom, width, height) fontSize:16];
        [self.contentView addSubview:typeL];
        self.typeL = typeL;
        
        UILabel *amountL = [Factory createLabelWithFrame:CGRectMake(left_dis, typeL.bottom, width, height) fontSize:16];
        [self.contentView addSubview:amountL];
        self.amountL = amountL;
    }
    return self;
}
-(void)setModel:(HXTFLConsumModel *)model{
    self.shopNameL.text = [NSString stringWithFormat:@"领取店铺：%@",model.shopName];
    self.goodNameL.text = [NSString stringWithFormat:@"福利名称：%@",model.goodName];
    self.typeL.text = [NSString stringWithFormat:@"福利类型：%@",model.type];
    self.amountL.text = [NSString stringWithFormat:@"领取数量：%@",model.amount];
}
+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellId = @"cellId";
    HXTConsumCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[HXTConsumCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
